<?php

class AdminRegimen extends FuncionComun{
	
	var $conexion;
	
	function AdminRegimen(){
		$this->conexion=new ConexionDB();
	}
	
	function setRegimen(Regimen $Regimen){
		
		
		$this->setObjectDB($Regimen,"Regimen");
		$this->setObjectDB($Regimen,"Datosregimen");
	}
	
	function getRegimens(){
		$consulta="SELECT * FROM regimen,datosregimen where id_regimen=id_regimen_datosregimen and id_temporada_datosregimen='1'  ORDER BY id_regimen";
		$this->conexion->realizarConsulta($consulta);
		return $this->conexion->getResultadosConsulta();
	}
	
	function getRegimen($id){
		$consulta="SELECT * FROM regimen WHERE id_Regimen=".$id;
		$this->conexion->realizarConsulta($consulta);
		$res=$this->conexion->getResultadosConsultaIdentify();
		return $this->getNewObject("Regimen",$res[0]);
	}
	function updateRegimen(Regimen $Regimen){
		$this->updateObject($Regimen,"datosregimen");
		$this->updateObject($Regimen,"Regimen");
		
	}
	function deleteRegimen(Regimen $Regimen){
			$this->deleteObject($Regimen,"Regimen");
	}
	function deletedatos($datos)
	{
		$consulta="delete from datosregimen where id_regimen_datosregimen=".$datos;
		$this->conexion->realizarConsulta($consulta);
	}
	
	
}
?>